<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html debug="true">
<head>
	<title>projectshen:tasks</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
	<cfset myself = viewstate.getValue("myself") />
	<cfset ticket = viewstate.getValue("ticket") />
	<cfset attribs = structNew() />
	<cfloop list="Priority,Status,Component,Version,Priority,Severity,Type,Milestone,Comments,attachments" index="attrib">
		<cfset attribs[attrib & "Query"] = viewstate.getValue(attrib & "Query")>
	</cfloop>
	<cfset ticketTO = ticket._getTO() />
	<style>

		.noticeMessage {
			display: block;
			float: right;
			font-weight: normal;
			font-family:Arial, Verdana, sans-serif;
			color:#663;
			font-size:0.9em;
		}

		.longinput INPUT {
			width:100%;
		}

			.firstLabel {
				display: inline-block;
				display: -moz-inline-box;
				width: 10em;
				min-width: 10em;
			}
			.secondLabel {
				width: auto;
				margin-left: 5em;
				margin-right: 1em;
			}
			fieldset label {
				margin-right: 1em;
			}


</style>

<script type="text/javascript" src="/srvinc/js/dojo-trunk/dojox/grid/tests/../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script>
<script type="text/javascript" src="/srvinc/js/dojo-trunk/dojox/grid/tests/../../../dijit/tests/_testCommon.js"></script>
<script type="text/javascript">
		dojo.require("dijit.form.Form");
		dojo.require("dijit.form.ValidationTextBox");
		dojo.require("dijit.form.ComboBox");
		dojo.require("dijit.form.FilteringSelect");
		dojo.require("dijit.TitlePane");
    dojo.require("dojo.data.ItemFileReadStore");
    dojo.require("dijit.Tree");
</script>
<script type="text/javascript">
</script>
</head>
<body class="tundra">
<div style="overflow-y: auto;overflow-x: hidden;padding-right:10px;">
<form dojoType="dijit.form.Form" id="ticketTab<cfoutput>#ticketTO.ticketId#</cfoutput>form"
onsubmit="alert('Execute form w/values:\n'+dojo.toJson(this.getValues(),true));return confirm('Show form values in the URL?')">

	<label for="name">Summary</label>
	<input type="text" id="summary" name="summary" class="longinput"
		dojoType="dijit.form.ValidationTextBox" style="width:48em"
		required="true" value="<cfoutput>#ticketTO.ticketSummary#</cfoutput>"
		ucfirst="true" invalidMessage="Enter the ticket summary"/>
			<br>
<span style="padding-right:10em">Status: <cfoutput>#ticketTO.ticketStatus#</cfoutput></span>
<span style="padding-right:10em">Created: <cfoutput>#dateFormat(ticketTO.ticketCreated)#</cfoutput></span>
<span style="padding-right:10em">Modifed: <cfoutput>#dateFormat(ticketTO.ticketModified)#</cfoutput></span>

	<div dojoType="dijit.TitlePane" title="Attributes" style="width: 100%;" open="false" >
				<label class="firstLabel" for="city">Status:</label>
				<span id="city"><cfoutput>#ticketTO.ticketStatus#</cfoutput></span>

				<label class="secondLabel" for="state">Resolution:</label>
				<span id="city"><cfoutput>#ticketTO.ticketResolution#</cfoutput></span>
				<br>
		<cfset attriblist = "Type,Component,Version,Severity,Milestone,Priority" />
		<cfloop list="#attriblist#" index="attrib">
				<label class="firstLabel" for="city"><cfoutput>#attrib#</cfoutput></label>
			 	<select dojoType="dijit.form.ComboBox"
		 			value=""
					autocomplete="true"
					hasDownArrow="true">
						<cftry>
					<cfset daQry = attribs[attrib & "Query"]>
					<cfoutput query="daQry">
						<option value="#daQry[attrib & "Name"][currentrow]#"<cfif daQry[attrib & "Name"][currentrow] eq ticketTo["ticket" & attrib]> selected</cfif>>#daQry[attrib & "Name"][currentrow]#</option>
					</cfoutput>
					<cfcatch>
					<cfdump var="#attrib#"><cfabort></cfcatch>
						</cftry>
				</select>
				<cfif listFind(attriblist,attrib) mod 2><br /></cfif>
		</cfloop>
				<label class="firstLabel" for="ticketpriorityorder">Priority Order</label>
				<input id="ticketpriorityorder" name="ticketpriorityorder"
					dojoType="dijit.form.NumberSpinner"
					value="<cfoutput>#ticketTO["ticketpriorityorder"]#</cfoutput>" 
					invalidMessage=""/>
				<label class="firstLabel" for="state">Keywords</label>
				<input type="text" id="keywords" name="keywords"
					dojoType="dijit.form.ValidationTextBox"
					required="false" value="<cfoutput>#ticketTO["ticketkeywords"]#</cfoutput>" 
					ucfirst="true" invalidMessage=""/>
	</div>

	<div dojoType="dijit.TitlePane" title="Attachments" style="width: 100%;" open="false" >
		<p>No attachments</p>
		<button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type=submit>
			Attach File
		</button>
		<button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type=submit>
			Attach Screenshot
		</button>
	</div>
	<div dojoType="dijit.TitlePane" title="Description" style="width: 100%;">
		<textarea dojoType="dijit.Editor" minHeight="3em" height="10em" id="description" name="description"><cfoutput>#ticketTo["ticketDescription"]#</cfoutput></textarea>
	</div>
	<div dojoType="dijit.TitlePane" title="Comments" style="width: 100%;" open="false" >
		<div dojoType="dojo.data.ItemFileReadStore" url="<cfoutput>#myself#project.json&method=ticket.changelog&ticketID=#ticketTo["ticketId"]#</cfoutput>" jsid="popStore"></div>
    <div dojoType="dijit.Tree" store="popStore" labelAttr="name" label="Pop Tarts"></div>
		<cfset commentsQry = attribs["CommentsQuery"] />
		<cfoutput query="commentsQry">
		<a href="#commentId#">#dateFormat(createdate,"ddd, mmm d ")# #timeFormat(createdate,"long")# #year(createDate)#</a><br/>
		#commentText#<br /><br />
		</cfoutput>
	</div>
	<div dojoType="dijit.TitlePane" title="New Comment" style="width: 100%;">
		<textarea dojoType="dijit.Editor" minHeight="3em" height="7em" id="comment" name="comment"><cfoutput>#ticketTo["ticketDescription"]#</cfoutput></textarea>
	</div>
	<div dojoType="dijit.layout.SplitContainer"
    orientation="horizontal"
    sizerWidth="7"
    activeSizing="true" style="width:100%;height:120px;">
		<div dojoType="dijit.TitlePane" title="Actions" style="width:20em" sizeShare="50">
			Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
			nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
			consectetuer adipiscing elit.
		</div>
		<div dojoType="dijit.TitlePane" title="People" style="width:20em" sizeShare="50">
			Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
			nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
			consectetuer adipiscing elit.
		</div>
	</div>
	<button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type=submit>
		Submit Ticket
	</button>

</form>
</div>
</body>
</html>
